import java.util.Date;

public class candyTransaction extends transaction
{
	double moneyRecieved;
	int price1bought, price2bought, price3bought, price4bought;
	Date today;
	candyTransaction next;
	
	public candyTransaction()
	{
		today = new Date();
		next = null;
	}
	
	public String toString()
	{
		String temp = "candy Transaction: ";
		temp = temp
			+ today 
			+ " total price: " + getCost()
			+ " money recieved: " + moneyRecieved
			+ " candy 1: " + price1bought
			+ " candy 2: " + price2bought
			+ " candy 3: " + price3bought
			+ " candy 4: " + price4bought
			+ " profit: " + getProfit();
		return temp;
	}
	
	public candyTransaction(double moneyIn, int a, int b, int c, int d)
	{
		today = new Date();
		next = null;
		moneyRecieved = moneyIn;
		price1bought = a;
		price2bought = b;
		price3bought = c;
		price4bought = d;
		

	}
	


	public double getProfit()
	{
		double temp = 0;
		temp += (price1bought * candy.profit1);
		temp += (price2bought * candy.profit1);
		temp += (price3bought * candy.profit3);
		temp += (price4bought * candy.profit4);
		return temp;
	}
	
	
	public double getCost()
	{
		double temp = 0;
		temp += (price1bought * candy.price1);
		temp += (price2bought * candy.price2);
		temp += (price3bought * candy.price3);
		temp += (price4bought * candy.price4);
		return temp;
	}
	

}